<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div ng-controller="HomeCtrl as home" data-ng-init="initHome()">
  <div ng-show="home.staticHome" class="box width-full home" style="min-height: 600px;">
    <div class="zeppelin">
      <div class="zeppelin2"></div>
    </div>
    <div style="margin-top: -380px;">
      <h1 class="box-heading" id="welcome">
        欢迎使用税务分析平台!
      </h1>
      支持创建基于SQL和Python，MongoDB的模型分析!<br/>

      <div class="row">
        <div class="col-md-4" ng-if="ticket">
          <h4>模型
            <i ng-class="isReloadingNotes ? 'fa fa-refresh fa-spin' : 'fa fa-refresh'" ng-style="!isReloadingNotes && {'cursor': 'pointer'}"
              style="font-size: 13px;" ng-click="reloadNoteList();" tooltip-placement="bottom" uib-tooltip="Reload notes from storage">
            </i>
          </h4>

          <div>
            <h5><a href="" data-toggle="modal" data-target="#noteImportModal" style="text-decoration: none;">
              <i style="font-size: 15px;" class="fa fa-upload"></i> 导入模型</a></h5>
            <h5 ng-controller="NoteCreateCtrl as noteCreateCtrl"><a href="" data-toggle="modal" data-target="#noteCreateModal" style="text-decoration: none;" ng-click="noteCreateCtrl.getInterpreterSettings()">
              <i style="font-size: 15px;" class="icon-notebook"></i> 创建模型</a></h5>
            <ul id="notebook-names">
              <li class="filter-names" ng-include="'components/note-name-filter/note-name-filter.html'"></li>
              <li ng-repeat="note in home.notes.list | filter:query.q | orderBy:node:false:home.arrayOrderingSrv.noteComparator track by $index">
                <i style="font-size: 10px;" class="icon-doc"></i>
                <a style="text-decoration: none;" href="#/notebook/{{note.id}}">{{noteName(note)}}</a>
              </li>
              <div ng-if="!query.q || query.q === ''">
                <li ng-repeat="node in home.notes.root.children | orderBy:node:false:home.arrayOrderingSrv.noteComparator track by $index"
                  ng-include src="'app/home/notebook-template.html'" ng-class="note_folder_renderer"></li>
              </div>
              <div ng-if="query.q">
                <li ng-repeat="node in home.notes.flatList| filter:query.q | orderBy:home.arrayOrderingSrv.noteFlatListOrdering track by $index"
                  ng-include src="'app/home/notebook-template.html'" ng-class="note_folder_renderer"></li>
              </div>
            </ul>
          </div>
        </div>
        <div class="col-md-6">
          <!--
          <h4>帮助</h4>
          Get started with <a style="text-decoration: none;" target="_blank"
                              href="http://zeppelin.apache.org/docs/{{zeppelinVersion}}/index.html">Zeppelin documentation</a><br/>

          <h4>Community</h4>
          Please feel free to help us to improve Zeppelin, <br/>
          Any contribution are welcome!<br/><br/>
          <a style="text-decoration: none;" href="http://zeppelin.apache.org/community.html"
             target="_blank"><i style="font-size: 15px;" class="fa fa-users"></i> Mailing list</a><br/>
          <a style="text-decoration: none;" href="https://issues.apache.org/jira/browse/ZEPPELIN"
             target="_blank"><i style="font-size: 15px;" class="fa fa-bug"></i> Issues tracking</a><br/>
          <a style="text-decoration: none;" href="https://github.com/apache/zeppelin"
             target="_blank"><i style="font-size: 20px;" class="fa fa-github"></i> Github</a>
          -->
        </div>
      </div>
    </div>
    <br/><br/><br/>
  </div>


  <!-- Load notebook -->
  <div ng-show="home.notebookHome" id="{{currentParagraph.id}}_paragraphColumn_main" ng-repeat="currentParagraph in home.note.paragraphs"
    ng-controller="ParagraphCtrl" ng-init="init(currentParagraph, home.note)" ng-class="columnWidthClass(currentParagraph.config.colWidth)"
    style="margin: 0; padding: 0;">
    <div id="{{currentParagraph.id}}_paragraphColumn" ng-if="currentParagraph.results" ng-include src="'app/notebook/paragraph/paragraph.html'"
      ng-class="{'paragraph-space box paragraph-margin': !asIframe, 'focused': paragraphFocused}" ng-hide="currentParagraph.config.tableHide && home.viewOnly">
    </div>
  </div>

  <div style="clear:both;height:10px"></div>
</div>
<div style="position:fixed;bottom: 0px;height: 20px; width: 100%;padding-left: 0px;">
  <div style="width: 300px;margin: 0 auto;">&copy; 2017 江西地方税务局税务分析平台</div>
</div>